<template>
  <table-where :forms="forms" @onSubmit="onSubmit"></table-where>
  <wms-table ref="tableQuery" :tableDatas="tableDatas" @editHandle="editHandle"></wms-table>
</template>

<script setup name="菜单">
import { ref, reactive } from 'vue'
import http from '@/components/utils/http'
import {go} from '@/components/utils/api'
import { useRouter } from 'vue-router'
const router = useRouter()
const tableDatas = reactive({
  body: {
    //表数据
    head: 'wmsMenu',
    url: '/Menu/MenuPage',
    params: {},
    type: 'POSTJSON'
  },
  delete: {
    url: '/Menu/deleteMenu',
    params:{id:"id"}
  },
  edit: {
    params:{id:"id"}
  },
})
const tableQuery = ref()
const editHandle = ({row})=>{
  go(router,"/addMenu",row)
}
const onSubmit = ()=>{
  tableQuery.value.getData()
}
const forms = reactive({
  data:tableDatas.body.params,
  rules:[],
  compValue:[
    {label:"编号",value:"serial_number",type:'iconinput',placeholder:"asd",show:true,onclick:()=>{
      console.log(12);
      
    }},
    {label:"名称",value:"menu_name",type:'iconinput',placeholder:"asd"},
    {label:"新增",type:'button',onclick:()=>{
      // router.push("/addMenu")
      go(router,"/addMenu")
    }},
    {label:"查询",type:'button',onclick:onSubmit}
  ],

})

</script>
